package com.example.xd.javatest.factory_test.sample;

import com.example.xd.javatest.factory_test.Audi;
import com.example.xd.javatest.factory_test.Byd;
import com.example.xd.javatest.factory_test.Car;

/**
 * @auther XuDan on 2020/6/16.
 * 增加新的子类时,需要自改原有的方法(违反开闭原则)
 */
public class CarFactory2 {
    public static Car createAudi() {
        return new Audi();
    }

    public static Car createByd() {
        return new Byd();
    }
}
